package com.liu.service.impl;

import com.liu.entity.Province;
import com.liu.mapper.ProvinceMapper;
import com.liu.service.ProvinceService;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Province)表服务实现类
 *
 * @author makejava
 * @since 2023-03-05 21:48:34
 */
@Service("provinceServiceImpl")
@Transactional
public class ProvinceServiceImpl implements ProvinceService {
    @Resource
    private ProvinceMapper provinceMapper;


    @Override
    public Province queryById(Integer id) {
        return this.provinceMapper.queryById(id);
    }

    @Override
    public List<Province> findAll() {
        return this.provinceMapper.findAll();
    }

    @Override
    public List<Province> queryAllByLimit(Integer pageNum, Integer pageSize, String name) {
        return this.provinceMapper.queryAllByLimit(pageNum, pageSize, name);
    }

    @Override
    public long count(String name) {
        return this.provinceMapper.count(name);
    }

    @Override
    public int insert(Province province) {
        return this.provinceMapper.insert(province);
    }

    @Override
    public int insertBatch(List<Province> entities) {
        return this.provinceMapper.insertBatch(entities);
    }

    @Override
    public int update(Province province) {
        return this.provinceMapper.update(province);
    }

    @Override
    public int deleteById(Integer id) {
        return this.provinceMapper.deleteById(id);
    }

    @Override
    public int deleteByIds(List<Integer> ids) {
        return this.provinceMapper.deleteByIds(ids);
    }
}
